/**
 * This file is part of aion-emu <aion-emu.com>.
 *
 *  aion-emu is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  aion-emu is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with aion-emu.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.aionemu.gameserver.network.aion.serverpackets;

import java.util.List;

import com.aionemu.gameserver.network.aion.AbstractAionServerPacket;
import com.aionemu.gameserver.network.aion.GameClient;

public class SM_EMOTION_LIST extends AbstractAionServerPacket<GameClient>
{
	byte			action;
	List<Integer>	emotions;

	/**
	 * @param action
	 */
	public SM_EMOTION_LIST(byte action, List<Integer> emotions)
	{
		this.action = action;
		this.emotions = emotions;
	}

	@Override
	protected void writeImpl(GameClient client)
	{
		writeC(action);
		if (emotions == null || emotions.isEmpty())
			writeH(0);
		else
		{
			writeH(emotions.size());
			for (int emotion : emotions)
			{
				writeD(emotion);
				writeD(0x00);
			}
		}
	}
}